<template>
	<view class="list">
		<template v-for="(item,index) in list" :key="index">
			<view class="item" @click="openDetail(item)">
				<view class="format">
					<doc-format :filetype="item.filetype" />
				</view>
				<view class="info">
					<view class="title">
						<text>{{item.title}}</text>
					</view>
					<view class="time">
						<text>发布时间：{{item.senddate}} | </text>
						<text>页数：{{item.pagenumber}} | </text>
						<text>大小：{{item.filesize}}</text>
					</view>
				</view>
			</view>
		</template>
	</view>
</template>
<script setup>
	defineProps({
		list: Array
	});
	// 打开原创力详情
	function openDetail(item) {
		// 跳转小程序
		uni.navigateToMiniProgram({
			appId: 'wx42fd2c9c759f7f59',
			path: `pages/detail/detail?aid=${item.encode_aid}&senddate=${item.senddate.split('-').join('')}`,
			envVersion: 'release',
			success() {},
			fail() {}
		});
	}
</script>
<style scoped lang="scss">
	@import '@/common/css/base.scss';
	.list {
		margin: 24rpx 0;
		background-color: #fff;
	}
	.item {
		@include flex;
		align-items: flex-start;
		margin-left: 32rpx;
		padding: 32rpx 32rpx 0 0;
		border-bottom: 1px solid #ddd;
		&:last-child {
			border-bottom: none;
		}
		.format {
			width: 60rpx;
			padding: 10rpx 0;
			.icon {
				font-size: 42rpx;
				&-doc {
					color: #6CCBFF;
				}
				&-pdf {
					color: #FF5562;
				}
				&-ppt {
					color: #FF8976;
				}
				&-xls {
					color: #5ACC9B;
				}
			}
		}
		.info {
			flex: 1;
			.title {
				line-height: 48rpx;
				word-break: break-all;
				font-size: 34rpx;
				color: #000;
			}
			.time {
				display: inline-block;
				line-height: 24rpx;
				height: 24rpx;
				margin: 20rpx 0 24rpx;
				overflow: hidden;
				font-size: 24rpx;
				color: #999;
			}
		}
	}
</style>
